package com.weixing.mall.provider.controller.rpc;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.weixing.mall.base.enums.WhetherEnum;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.domain.LeaveMessage;
import com.weixing.mall.provider.service.ILeaveMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/leavemessage")
public class LeaveMessageRpcController  extends BaseController {
    @Autowired
    private ILeaveMessageService leaveMessageService;

    @GetMapping("/noReplyList")
    public Map<String,Integer> noReplyList(){
        List lists = leaveMessageService.list(new QueryWrapper<LeaveMessage>().eq("is_reply", WhetherEnum.NO.getValue()));
        Map<String,Integer> tt=new HashMap<String,Integer>();
        tt.put("noReply",lists.size());
        return tt;
    }
}
